local fenyong = fk.CreateSkill {
  name = "lingling__fenyong",
}

Fk:loadTranslationTable {
  ["lingling__fenyong"] = "愤咏",
  [":lingling__fenyong"] = "出牌阶段限一次，你可以令一名角色随机获得两张锦囊牌（不能连续指定同一名角色，若为你则额外获得一张），然后对其造成1点伤害。",

  ["#lingling__fenyong"] = "愤咏：令一名角色随机获得两张锦囊牌，并受到你的1点伤害！",
}

fenyong:addEffect("active", {
  anim_type = "drawcard",
  card_num = 0,
  target_num = 1,
  prompt = "#lingling__fenyong",
  can_use = function(self, player)
    return player:usedSkillTimes(fenyong.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and player:getMark("lingling__fenyong_record") ~= to_select.id
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:setPlayerMark(player, "lingling__fenyong_record", target.id)
    local num = target == player and 3 or 2
    local cards = room:getCardsFromPileByRule(".|.|.|.|.|trick", num, "allPiles")
    if #cards > 0 and not target.dead then
      room:moveCardTo(cards, Card.PlayerHand, target, fk.ReasonJustMove, fenyong.name, nil, true, player)
    end
    if not target.dead then
      room:damage {
        from = player,
        to = target,
        damage = 1,
        skillName = fenyong.name
      }
    end
  end,
})

return fenyong
